﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Markup;
using System.Web;

namespace UIT.Web.Markup
{
    [ContentProperty("Url")]
    public class ResolveUrl : MarkupExtension
    {
        public ResolveUrl()
        {

        }

        public ResolveUrl(string url)
        {
            Url = url;
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return Process(Url);
        }

        public string Url { get; set; }

        internal static string Process(string url)
        {
            return VirtualPathUtility.ToAbsolute(url);
        }
    }
}
